home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Technotools
/
Technotools (Chestnut CD-ROM)(1993).ISO
/
lang_c
/
mc51bugs
/
q30447
< prev
next >
Wrap
Text File
|
1988-07-29
|
1KB
|
46 lines
Q30447 Code Generation Incorrect when Compiled with Default/Ot Option
C Compiler
5.10 | 5.10
MS-DOS | OS/2
Problem:
The code generated for the following example is incorrect when
compiled with the default options or with the /Ot option.
The code generated for the second assignment statement assumes that
the variable PBuf has not changed across the CALL to the function
bar(). Specifically, the second assignment is performed as PBuf->OffV
= PBuf->OffV.
The following is a sample code:
struct Ptrace_B {
unsigned Value;
unsigned OffV;
unsigned SegV;
};
struct FP_Regs_B {
unsigned DataOffset;
unsigned DataSelector;
};
typedef unsigned short WORD;
typedef unsigned long WORD;
struct Ptrace_B *PBuf;
foo()
{
struct FP_Regs_B FP_Regs;
PBuf->OffV = ((WORD)(char far *) &FP_Regs);
bar();
PBuf->OffV = ((WORD)(char far *) &FP_Regs);
}
Response:
Microsoft has confirmed this to be a problem in the C Compiler
Version 5.10. We are researching this problem and will post new
information as it becomes available.
You can work around this problem by not optimizing for time (i.e.,
do not use /Ot).
Keywords: buglist5.10
Updated 88/07/29 14:28